#include <iostream>
#include <cstdio>
using namespace std;
int T,n,m,L,V,d[1000005],v[1005],a[1005],p[100005];
int main(){
    freopen("detect.in","r",stdin);
    freopen("detect.out","w",stdout);
    cin>>T;
    for(int i=1;i<=T;i++){
		cin>>n>>m>>L>>V;
		for(int j=1;j<=n;j++){
			cin>>d[j]>>v[j]>>a[j];
		}
		for(int j=1;j<=m;j++){
			cin>>p[j];
		}
	}
	return 0;
}
